/*
 * IndexHeaderPage.h
 *
 *  Created on: 30-Oct-2013
 *      Author: sriram
 */

#ifndef INDEXHEADERPAGE_H_
#define INDEXHEADERPAGE_H_
#include "../Global/StructureHeaders.h"
using namespace std;
class IndexHeaderPage {
private:
	typedef struct IndexPageHeaderStructure{
		PageHeader pgHeader;
		int rootPageNumber;
		int fanOut;
		int height;
		int maxRecordsInLeaf;
		int keySize;
		int noKeys;
		int noColumns;
	}IndexPageheaderStructure;

	IndexPageHeaderStructure indexPageHeader_;
	char *pageData_;

	int *colTypes_, *colSizes_;
public:

	void initializeColumnInformation();
	IndexHeaderPage();
	IndexHeaderPage(int indexHeaderPageNumber);
	STATUS_CODE createIndexHeaderPage(int noColumns, int colTypes[], int colSizes[], int keySize);
        STATUS_CODE createIndexHeaderPage(int noColumns, int fanout, int colTypes[], int colSizes[], int keySize);
	virtual ~IndexHeaderPage();

	int getFanOut();
	void setFanOut(int fanOut);
	int getHeight();
	void setHeight(int height);
	int getKeySize();
	void setKeySize(int keySize);
	int getMaxRecordsInLeaf();
	void setMaxRecordsInLeaf(int maxRecordsInLeaf);
	int getNoColumns();
	void setNoColumns(int noColumns);
	int getNoKeys();
	void setNoKeys(int noKeys);
	int getRootPageNumber();
	void setRootPageNumber(int rootPageNumber);
	int getPageNumber();
	string toString();
        int* getColTypes();
        int* getColSizes();
};

#endif /* INDEXHEADERPAGE_H_ */
